<template>
	<div class="container">
		<div class="jx-container">
      <el-form ref="form" :model="params_list" :rules="rules" label-width="130px" class="jx-form">
        <div class="jx-detail">
          <div class="detail-item">
            <div class="item">
              <el-form-item label="我的银行卡：" prop="bank">
                <el-select class="tel-value" v-model="params_list.bank" placeholder="请选择">
                  <el-option label="招商银行（尾号2133）" value="1"></el-option>
                  <el-option label="邮政银行（尾号2153）" value="2"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="可提现金额：" prop="amount">
                <el-input v-model="params_list.amount" placeholder="当前可提现金额200.00元">
                </el-input>
                <span class="gray" style="margin-right: 10px;">元</span>
                <el-button type="text" @click="allRow">全部提现</el-button>
              </el-form-item>
              <el-form-item label="提现手续费：" >
                <span class="red">￥5.00</span><span class="gray">元</span>
                <el-button type="text" style="margin-left: 30px;">提现手续费说明</el-button>
              </el-form-item>
              <el-form-item label="交易密码：" prop="password">
                <el-input v-model="params_list.password" type="password" placeholder="请输入交易密码">
                </el-input>
              </el-form-item>
            </div>
          </div>
        </div> 
      </el-form>
      <div class="btn-container">
        <el-button class="jx-btn" type="primary" :loading="boo.saveing" @click="submitRow('form')">确定</el-button>
      </div>
    </div>
    <!-- 提现说明 -->
    <el-dialog  :visible.sync="boo.showDialog" class="jx-dialog" width="45%">
      <div slot="title" class="header-title">
        <span class="title-name">提现说明</span>
      </div>
      <div class="code-recharge">
        <img src="/static/img/u2411.png"/>
        <span>提现申请成功，等待处理</span>
      </div>
      <div class="info">
        <span>到账时间说明：</span>
        <div style="color: #999;margin: 15px 0;">
          工作日下午16:00之前申请的提现会在次日16:00前到账，16:00点后申请的提现，将在下下个工作日到账。周末及法定节假日提现顺延到下个工作日到账。
        </div>
      </div>
    </el-dialog>
	</div>
</template>

<script>
	export default {
		data() {
			return {
        https: {
          // list: this.$api.setting.index,
        },
        boo: {
          saveing: false,
          showDialog: false,
        },
        params_list: {
          bank: '',
          amount: '',
          password: '',
        },
        rules: {
          bank: [{ required: true, message: '请选择银行卡', trigger: 'change' }],
          amount: [{ required: true, message: '请输入提现金额', trigger: 'blur' }],
          password: [{ required: true, message: '请输入交易密码', trigger: 'blur' }],
        },
			}
		},
		mounted(){
      let _self = this
      _self.getList()
    },
		methods: {
      getList(){
        let _self = this
        let params = {}
        // let success = (res)=>{
        //   res = res.data
        //   if(res.retCode == 1){
        //     _self.params_list = res.retObject
        //   }else{
        //     _self.$message.error(res.retMsg)
        //   }
        // }
        // _self.$axios.get(_self.https.list.list, params, success) 
      },
      allRow(){
        let _self = this
        _self.params_list.amount = '200.00'
      },
      submitRow(formName){
        let _self = this
				this.$refs[formName].validate((vaild)=>{
					if(vaild){  
            // _self.boo.saveing = true
            let params = {
              bank: _self.params_list.bank,
              amount: _self.params_list.amount,
              password: _self.params_list.password,
            }    
            _self.boo.showDialog = true
            console.log(params)
            // let success = (res)=>{
            //   res = res.data
            //   if(res.retCode == 1){
            //     _self.$message.success('基本设置成功')
            //   }else{
            //     _self.$message.error(res.retMsg)
            //   }
            //   _self.boo.saveing = false
            // }
            // _self.$axios.body(_self.https.list.add, params, success)   
					}else{
						return false
					}
				})
      }
    }
	}

</script>
<style scoped lang="sass">
  .jx-form .el-input--small, .jx-form .el-textarea, .jx-form .el-select--small
    width: 425px
  .gray
    display: inline-block
  .jx-form /deep/ .el-form-item__label
    color: #333
  .code-recharge
    text-align: center
    margin-bottom: 30px
    img
      display: block 
      margin: 0 auto 10px
      width: 90px
</style>
